import pandas as pd
import os
import numpy as np

file_path="dealed_data/test_trace_sample.csv"

df_all=pd.read_csv(file_path)

value_list=df_all.groupby("traceid")["service"].unique().explode().value_counts().sort_values(ascending=False).head(2).reset_index()["service"].tolist()
service_to_times=df_all.groupby("traceid")["service"].unique().explode().value_counts().sort_values(ascending=False)
print(len(service_to_times))
print(value_list)